package bean;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="Aula")
public class Aula {
	
	@Id
	private int codAula;
	
	@JoinColumn(name = "codDia", referencedColumnName = "codDia")
	@ManyToOne
	private Dia dia;
	
	@JoinColumn(name = "codHorario", referencedColumnName = "codHorario")
	@ManyToOne
	private Horarios horario;
	
	@JoinColumn(name = "codDisciplina", referencedColumnName = "codDisciplina")
	@ManyToOne
	private Disciplina disciplina;

	
	public int getCodAula() {
		return codAula;
	}

	public void setCodAula(int codAula) {
		this.codAula = codAula;
	}
	
	public Dia getDia() {
		return dia;
	}

	public void setDia(Dia dia) {
		this.dia = dia;
	}

	public Horarios getHorario() {
		return horario;
	}

	public void setHorario(Horarios horario) {
		this.horario = horario;
	}

	public Disciplina getDisciplina() {
		return disciplina;
	}

	public void setDisciplina(Disciplina disciplina) {
		this.disciplina = disciplina;
	}

	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Aula){
			Aula p = (Aula) obj;
			if(p.getCodAula() == this.getCodAula()){
				return true;
			}
		}
		return false;
	}

}
